<?php
$this->breadcrumbs=array(
	'Daft. Medic',
);

function sortByHari($a, $b) {
		return $a->hari - $b->hari;
	}

$this->menu=array(
	array('label'=>'Tambah Medic','url'=>array('create')),
	array('label'=>'Edit Medic','url'=>array('admin')),
);
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('tr-mmr-grid', {
		data: $(this).serialize()
	});
	return false;
}
);
$('.reset-button').click(function(){	
	return true;
});

");
?>
<?php echo CHtml::link('Search','#',array('class'=>'search-button btn')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array('model'=>$model,)); ?>
</div><!-- search-form -->
<?php echo CHtml::link('Display All','index.php?r=fo/trMMedic/index',array('class'=>'reset-button btn')); ?>
<div style="width: 98%;">
<?php

//var_dump($model->trMMedicSch);
    //var_dump($model->search()->trMMedicSch);

    $this->widget('zii.widgets.CListView', array(
        //    'dataProvider'=>$dataProvider,
	'dataProvider'=>$model->search(),
	'itemView'=>'_view',	
	'template'=>'{sorter}{pager} <br />{items}',
	'enableSorting' => true,
	'sortableAttributes'=>array(
            'name'=>'Sort',
        ),
)); ?>
</div>
